package com.cfh.web.admin.interceptor;

import com.cfh.domain.User;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class SafeLoginLevelIntercepter extends AbstractInterceptor {

	private static final long serialVersionUID = 1L;

	public String intercept(ActionInvocation ai) throws Exception {
		User loginuser = (User) ai.getInvocationContext().getSession().get(
				"currentUser");
		if (loginuser != null) {
			return ai.invoke();
		} else {
			return Action.LOGIN;
		}
	}

}
